/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-11-24 23:34:51
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.service;

import com.joysuch.wwyt.api.base.dto.ApiDepartDto;
import com.joysuch.wwyt.bp.bean.*;
import com.joysuch.wwyt.bp.bean.BpDepartBean.SearchDepartBean;
import com.joysuch.wwyt.bp.entity.BpDepart;
import com.joysuch.wwyt.core.bean.SimpleInfoBean;
import com.joysuch.wwyt.core.bean.SimpleSelectListBean;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.dzhapi.dto.BuildDataDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BpDepartService {

    public static void findIdByName(String parentDepartName) {
    }

    public void add(BpDepart entity);

    void update(BpDepart entity);

    BpDepartBean findByPage(Pageable page);

    void delete(Long id) throws ApiBusinessException;

    void apiDelete(Long id, BuildDataDto dto);

    BpDepart findById(Long id);

    Page<BpDepartListBean> get(Long id, Pageable page);

    DpDepartUserBean getUser();

    public Page<SimpleInfoBean> findByPageSimple(Pageable page, SearchDepartBean condition);


    public ResultBean getDepartDutyUser(Long departId);

    public List<BpDepart> findAllDepartByTenentId(Long tenentId);

    ResultBean getDepartByUserId(Long userId);

    ResultBean getNDepartDutyUser(DepartDutyUserBean bean);

    List<SimpleSelectListBean> getList();

    List<BpDepartTreeBean> getDepartList();

    Page<BpDepartListBean> getListByParentId(Pageable page, BpDepartSearchBean bean);

    Page<SimpleInfoBean> getDeptPmsList(Pageable page, SearchDepartBean condition);

    List<SimpleSelectListBean> getDeptPmsList();

    List<String> deleteByIds(List<Long> ids) throws ApiBusinessException;

    /**
     *  查看所有部门信息
     * @param departName
     * @param departCode
     * @param tenentId
     * @param orgCode
     * @return
     */
    List<ApiDepartDto> getListForApi(String departName, String departCode, Long tenentId, String orgCode);

    /**
     * 分页查看部门信息
     * @param departName
     * @param departCode
     * @param tenentId
     * @param orgCode
     * @return
     */
    com.baomidou.mybatisplus.extension.plugins.pagination.Page<ApiDepartDto> getListByPageForApi(Integer page , Integer size , String departName, String departCode, Long tenentId, String orgCode);

    Map<Long, BpDepart> getDepartMapByIds(List<Long> udIds);

    public BpDepart getFatherDepart(Long tenentId, String orgCode);

    List<ApiDepartDto> findListByChiefId(Long chiefId, Long tenantId, String orgCode);
}
